// mock数据模拟
import Mock from 'mockjs'

// 图表数据
let List = []
let List1 = []
export default {
    getStatisticalData: () => {
        //Mock.Random.float 产生随机数100到8000之间 保留小数 最小0位 最大0位
        for (let i = 0; i < 7; i++) {
            List.push(
                Mock.mock({
                    苹果: Mock.Random.float(0, 30000, 0, 0),
                    vivo: Mock.Random.float(0, 15000, 0, 0),
                    oppo: Mock.Random.float(0, 15000, 0, 0),
                    魅族: Mock.Random.float(0, 10000, 0, 0),
                    三星: Mock.Random.float(0, 20000, 0, 0),
                    小米: Mock.Random.float(0, 20000, 0, 0),
                    华为: Mock.Random.float(0, 30000, 0, 0)
                })
            )
            List1.push(
                Mock.mock({
                    '2022.10.01': Mock.Random.float(100, 8000, 0, 0),
                    '2022.10.02': Mock.Random.float(100, 8000, 0, 0),
                    '2022.10.03': Mock.Random.float(100, 8000, 0, 0),
                    '2022.10.04': Mock.Random.float(100, 8000, 0, 0),
                    '2022.10.05': Mock.Random.float(100, 8000, 0, 0),
                    '2022.10.06': Mock.Random.float(100, 8000, 0, 0),
                    '2022.10.07': Mock.Random.float(100, 8000, 0, 0),
                })
            )
        }
        return {
            code: 20000,
            data: {
                // 订单
                countData: [
                    {
                        name: "今日支付订单",
                        value: 1022,
                        icon: "success",
                        color: "#2ec7c9",
                    },
                    {
                        name: "今日收藏订单",
                        value: 316,
                        icon: "star-on",
                        color: "#ffb980",
                    },
                    {
                        name: "今日未支付订单",
                        value: 132,
                        icon: "s-goods",
                        color: "#5ab1ef",
                    },
                    {
                        name: "本月支付订单",
                        value: 35423,
                        icon: "success",
                        color: "#3dd56a",
                    },
                    {
                        name: "本月收藏订单",
                        value: 8642,
                        icon: "star-on",
                        color: "#fc8452",
                    },
                    {
                        name: "本月未支付订单",
                        value: 3956,
                        icon: "s-goods",
                        color: "#0f78f4",
                    },
                ],

                // 饼图
                videoData: [
                    {
                        name: '小米',
                        value: 2999
                    },
                    {
                        name: '苹果',
                        value: 5999
                    },
                    {
                        name: 'vivo',
                        value: 1500
                    },
                    {
                        name: 'oppo',
                        value: 1999
                    },
                    {
                        name: '魅族',
                        value: 2200
                    },
                    {
                        name: '三星',
                        value: 4500
                    },
                    {
                        name: '华为',
                        value: 6000
                    },
                ],
                // 柱状图
                userData: [
                    {
                        date: '周一',
                        new: 5,
                        active: 200
                    },
                    {
                        date: '周二',
                        new: 10,
                        active: 500
                    },
                    {
                        date: '周三',
                        new: 12,
                        active: 550
                    },
                    {
                        date: '周四',
                        new: 60,
                        active: 800
                    },
                    {
                        date: '周五',
                        new: 65,
                        active: 550
                    },
                    {
                        date: '周六',
                        new: 53,
                        active: 770
                    },
                    {
                        date: '周日',
                        new: 33,
                        active: 170
                    }
                ],
                // 折线图
                orderData: {
                    date: List1,
                    data: List
                },
                tableData: [
                    {
                        name: '苹果',
                        todayBuy: 500,
                        monthBuy: 3500,
                        totalBuy: 85000
                    },
                    {
                        name: 'vivo',
                        todayBuy: 300,
                        monthBuy: 2200,
                        totalBuy: 24000
                    },
                    {
                        name: 'oppo',
                        todayBuy: 800,
                        monthBuy: 4500,
                        totalBuy: 65000
                    },
                    {
                        name: '魅族',
                        todayBuy: 1200,
                        monthBuy: 6500,
                        totalBuy: 22000
                    },
                    {
                        name: '三星',
                        todayBuy: 300,
                        monthBuy: 2000,
                        totalBuy: 34000
                    },
                    {
                        name: '小米',
                        todayBuy: 350,
                        monthBuy: 3000,
                        totalBuy: 22000
                    },
                    {
                        name: '华为',
                        todayBuy: 350,
                        monthBuy: 3000,
                        totalBuy: 85000
                    }
                ]
            }
        }
    }
}